<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>后台管理面板</title>
    <!-- 告诉浏览器该页面是自适应布局 -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    {include file="common/top" /}
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <div class="content-wrapper" style="margin-left: 0 !important;">
        <!--页眉-->
        <section class="content-header">
            <h1>废料信息列表</h1>
        </section>
        <!--内容开始-->
        <section class="content">
            <div class="search">
                <form class="form-inline" action="{:url('admin/order/download')}" onsubmit="return toVaild()">
                    <div class="input-group date">
                        <div class="input-group-addon">
                          <i class="fa fa-calendar"></i>
                        </div>
                        <input type="text" class="form-control pull-right" name="download" id="datepicker">
                        <input type="hidden" name="ff" id="ff">
                      </div>
                    <button class="btn btn-flat btn-primary" data-toggle="modal" type="submit" value="下载">下载</button>
                    <!--{:url('admin/order/allDown')}-->
                </form>

            </div>
            <!--数据表开始-->
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                            <!-- /.box-header -->
                            <div class="box-body table-responsive no-padding">
                                <table class="table table-bordered table-hover">
                                    <tr>
                                        <th class="t_c"><input type="checkbox" id="check"></th>
                                        <th class="t_c">编号</th>
                                        <th class="t_c">医疗机构名称</th>
                                        <th class="t_c">HW01 831-001-01感染性废物</th>
                                        <th class="t_c">HW01 831-002-01损伤性废物</th>
                                        <th class="t_c">HW01 831-003-01病理性废物</th>
                                        <th class="t_c">HW01 831-004-01化学性废物</th>
                                        <th class="t_c">HW01 900-001-01为防治动物传染病而需要收集和处置的废物</th>
                                        <th class="t_c">提交日期</th>
                                        <th class="t_c">操作</th>
                                    </tr>
                                    {volist name='list' id='list' empty="$empty"}
                                    <tr>
                                        <td class="t_c"><input type="checkbox" name="key[]" value="{$list.id}"></td>
                                        <td class="t_c">{$list.id}</td>
                                        <td class="t_c">{$list.users.department}</td>
                                        <td class="t_c">{$list.hw_001}</td>
                                        <td class="t_c">{$list.hw_002}</td>
                                        <td class="t_c">{$list.hw_003}</td>
                                        <td class="t_c">{$list.hw_004}</td>
                                        <td class="t_c">{$list.hw_900}</td>
                                        <td class="t_c">{$list.date}</td>
                                        <td class="t_c">
                                            <a class="btn btn-flat btn-warning btn-xs list_del" data-id="{$list.id}">
                                                <i class="fa fa-trash-o"></i> 删除
                                            </a>
                                        </td>
                                    </tr>
                                    {/volist}
                                </table>
                            </div>
                            <!-- /.box-body -->
                            <div class="box-footer clearfix page">
                                {$page|raw}
                                <!---->
                                {$pageSize|raw}
                                <!---->
                            </div>
                        </div>
                        <!-- /.box -->
                    </div>
                </div>
                <!--数据表结束-->
        </section>
        <!-- right col -->
    </div>
    <!-- /.row (main row) -->

    </section>
    <!--内容结束-->
</div>
</div>

<div class="modal" id="apply-edit">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <!--<h4 class="h4">设置员工信息</h4>-->
                <!--<button type="button" class="close" data-dismiss="modal">&times;</button>-->
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title">
                    下&nbsp;载
                </h4>
            </div>
            <div class="modal-body">
                <form id="down_order">
                <div class="box-body">
                    <div class="row">
                        <div class="col-md-9">
                            <div class="form-group">

                                <label>开始订单</label>
                                <select name="start_num" class="form-control">
                                    {volist name="all_order_num" id="vo"}
                                    <option selected="" value="{$vo.order_number}">{$vo.order_number}</option>
                                    {/volist}
                                </select>
                            </div>
                        </div>
                    </div>

                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label>结束订单</label>
                                    <select name="end_num" class="form-control">
                                        {volist name="all_order_num" id="vo"}
                                        <option selected="" value="{$vo.order_number}">{$vo.order_number}</option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-primary down_order" >确定</button>
                        </div>
                </div>
                </form>
            </div>
        </div>
        <!-- 修改菜单模态框结束 -->
    </div>
</div>


{include file="common/bottom" /}
<script src="/static/lib/layer/layer.js"></script>
<script language="javascript">
    function toVaild(){
        $("#ff").val(Math.random());
        return true;
    }
</script>
<script>

$('#datepicker').datepicker({
    format: 'yyyy-mm-dd',
    language:'zh-CN',
      autoclose: true
    })

    function no_Printing(){
        layer.msg('您的订单未完成不能打印');
    }
    //排序
    $(".changeSort").blur(function(){
        var url = "{:url('sort')}";
        var id = $(this).data("id");
        var sort = $(this).val();
        changeSort(url,id,sort);
    });

    //设置状态
    $(".state").click(function(){
        var url = "{:url('state')}";
        var id = $(this).data("id");
        changeState(url,id);
    });

    //删除
    $(".list_del").click(function(){
        var url = "{:url('admin/order/del')}";
        var id = $(this).data("id");
        delOne(url,id)
    })

    //批量删除
    $(".select_del").click(function(){
        var url = "{:url('admin/order/selectDel')}";
        delSelect(url);
    })
    //显示数量
    $(".page_size").change(function() {
        var page_size = $(this).val();
        var url = "{:url('admin/order/index',['keyword'=>$keyword,'page_size'=>'pagesize'])}";
        url =  url.replace("pagesize",page_size);
        window.location.replace(url);
    });
</script>
<script>
    $('.down_order').click(
        function () {
            var start_num = $('[name="start_num"]').val();
            var end_num = $('[name="end_num"]').val();
            if(start_num === end_num){
                layer.msg('开始订单不能和结束订单一致！');
                return false;
            }
            window.location.href = '{:url("admin/order/allDown")}?star='+start_num+'&end='+end_num;
            return false;
        }
    );
</script>

</body>
</html>